/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rg1threaddemo;

import java.util.Random;

/**
 *
 * @author apple
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("This is main Thread.");
        //MyThread myThread1=new MyThread("SubThread1");
        //MyThread myThread2=new MyThread("SubThread2");
        //MyThread myThread3=new MyThread("SubThread3");
        /*for(int i=0;i<10000;i++)
        {
            System.out.println("Main Thread:"+i);
        }*/
        
        //myThread1.start();
        //myThread2.start();
        //myThread3.start();
        /*MyRunnable myRunnable1=new MyRunnable();
        MyRunnable myRunnable2=new MyRunnable();
        MyRunnable myRunnable3=new MyRunnable();
        Thread thread1=new Thread(myRunnable1, "SubThread1");
        Thread thread2=new Thread(myRunnable2, "SubThread2");
        Thread thread3=new Thread(myRunnable3, "SubThread3");
        thread1.start();
        thread2.start();
        thread3.start();*/
        
        int[] array=new int[1000];
        Random rd=new Random();
        for(int i=0;i<1000;i++)
        {
            array[i]=rd.nextInt(800);
            System.out.println(array[i]);
        }
        System.out.println("");
        
        for(int i=0;i<10;i++)
        {
            NumThread numThread=new NumThread(array, 100*i);
            numThread.start();
        }
    }
    
}
